<!DOCTYPE html>
<html lang="cn" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>模型信息 Module Form</title>
    <meta name="renderer" content="webkit"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
    <link rel="stylesheet" th:href="@{/statics/layui/css/layui.css}" media="all"/>
    <link rel="stylesheet" th:href="@{/statics/style/admin.css}" media="all"/>
</head>
<body>

<div class="layui-form" lay-filter="layuiadmin-form-module" id="layuiadmin-form-module" style="padding: 20px 30px 0 0;">
    <div class="layui-form-item">
        <label class="layui-form-label">名称</label>
        <div class="layui-input-block">
            <input type="text"
                   name="name"
                   lay-verify="required"
                   autocomplete="off"
                   placeholder="请输入模型名称"
                   class="layui-input"
                   th:value="${module.name}"/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">代码</label>
        <div class="layui-input-block">
            <input type="text" name="code" lay-verify="required" autocomplete="off" placeholder="请输入模型代码"
                   class="layui-input" th:value="${module.code}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">类型</label>
        <div class="layui-input-block">
            <select name="type">
                <option value="1" th:selected="${1 == module.type ? 'true':'false'}">单页</option>
                <option value="2" th:selected="${2 == module.type ? 'true':'false'}">列表</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">列表视图</label>
        <div class="layui-input-block">
            <select name="listView">
                <option value="default" th:selected="${'default' == module.listView ? 'true':'false'}">默认列表</option>
                <option value="thumb" th:selected="${'thumb' == module.listView ? 'true':'false'}">默认视图</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">字段分组</label>
        <div class="layui-input-block">
            <input type="text"
                   name="tabs"
                   autocomplete="off"
                   placeholder="请输入字段分组"
                   class="layui-input"
                   th:value="${module.tabs}"/>
            <div class="layui-form-mid layui-word-aux">不填写表示不需要分组；多个分组需要用半角逗号隔开，并在添加或修改时分页显示。</div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">列表页</label>
        <div class="layui-input-block">
            <input type="text" name="listApi" autocomplete="off" placeholder="请输入模型列表页"
                   class="layui-input" th:value="${module.listApi}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">详情页</label>
        <div class="layui-input-block">
            <input type="text" name="getApi" autocomplete="off" placeholder="请输入模型详情页"
                   class="layui-input" th:value="${module.getApi}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-block">
            <input type="checkbox" name="status" lay-skin="switch" th:checked="${module.status ==1?'true':'false'}"/>
        </div>
    </div>
    <div class="layui-form-item layui-hide">
        <input type="hidden" name="id" th:value="${module.id}" autocomplete="off" class="layui-input">
        <button class="layui-btn" lay-submit lay-filter="LAY-module-add-submit" id="LAY-module-add-submit">提交</button>
    </div>
</div>

<script th:src="@{/statics/layui/layui.js}"></script>
<script>
    layui.config({
        base: '/statics/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form'], function () {
        var $ = layui.$
            , form = layui.form;
    })
</script>
</body>
</html>